package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.BannerDaoImpl;
import com.ysd.dao.impl.CompenyDaoImpl;
import com.ysd.entity.Banner;
import com.ysd.entity.Compeny;


public class HeadServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		CompenyDaoImpl cDao = new CompenyDaoImpl();
		Compeny c = cDao.getCompeny();
		request.setAttribute("c", c);
		
		BannerDaoImpl ban = new BannerDaoImpl();
		List<Banner> b = ban.getBanner();
		request.setAttribute("b", b);
		request.getRequestDispatcher("head.jsp").include(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		doGet(request, response);
	}

}
